package org.edunext.selenide;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class SimplePropertiesUtil {

    private static final Logger logger = LoggerFactory.getLogger(SimplePropertiesUtil.class);

    public static Properties loadProperties(String propertiesName) {
        InputStream in = SimplePropertiesUtil.class.getClassLoader().getResourceAsStream(propertiesName);
        Properties prop = new Properties();
        try {
            prop.load(in);
        } catch (IOException e) {
            logger.error(e.getMessage(), e);
        } finally {
            try {
                if (null != in) {
                    in.close();
                }
            } catch (IOException e) {
                logger.error(e.getMessage(), e);
            }
        }
        return prop;
    }

}

